<template>
  <div>
    <div class="top">
      <van-icon @click="goback" class="zuo" name="arrow-left" />
      注册用户
    </div>
    <van-cell-group>
      <van-field v-model="value" label="手机号" placeholder="请输入手机号" />
    </van-cell-group>
    <button class="go" @click="golncc">下一步</button>
  </div>
</template>

<script>
import { Toast } from 'vant';
export default {
  data() {
    return {
      value: "",
    };
  },
  methods: {
    goback() {
      this.$router.back();
    },
    golncc() {
      this.$server({
        method: "post",
        url: "user/docheckphone",
        data: {
          tel: this.value,
        },
      }).then((res) => {
        let data = res.data;
        console.log(data);
        if (data.code == 200) {
          this.$router.push("/Incc?tel="+this.value);
        } else {
          Toast('手机号已被注册或者格式不对');
        }
      });
    },
  },
};
</script>

<style scoped>
.top {
  width: 100%;
  height: 3.75rem;
  font-size: 1.25rem;
  text-align: center;
  line-height: 3.75rem;
  border-bottom: 0.0625rem solid black;
  position: relative;
}
.go {
  background-color: rgb(255, 166, 2);
  width: 18.75rem;
  height: 2.5rem;
  border-radius: 0.625rem;
  border: none;
  position: absolute;
  left: 2.5rem;
  top: 12.5rem;
}
.zuo {
  position: absolute;
  left: 0.625rem;
  font-size: 1.25rem;
  top: 1.375rem;
}
</style>